package com.example.liteflow.nd;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.slot.Slot;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;

/**
 * 节点组件信息
 *
 * @author chen.an
 * @date 2024-08-14 13:48
 */
@Slf4j
@LiteflowComponent(id = "Node3", name = "节点3")
public class Node3 extends NodeComponent {
    @Override
    public void process() throws Exception {
        Slot slot = this.getSlot();
        //如果上一步异步，则必须获取请求私有数据才能获取到数据
        Map<String, String> Node1 = slot.getPrivateDeliveryData("Node1");
        Map<String, String> Node2 = slot.getPrivateDeliveryData("Node2");

        log.info("Node3节点组件【{}】-Node ", Thread.currentThread().threadId());
        log.info("Node3,获取Node1数据：{} ", Node1);
        log.info("Node3,获取Node2数据：{} ", Node2);
        slot.setResponseData("Node3 运行接收完成");
    }
}
